﻿@model ShivamEMR.Model.Domain.CRMDomain.Appointment

@{
    ViewBag.Title = "New";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>New</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Appointment</legend>

		<div class="editor-label">
    @Html.LabelFor(model => model.DateAndTime)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.DateAndTime)
    @Html.ValidationMessageFor(model => model.DateAndTime)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Occation)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Occation)
    @Html.ValidationMessageFor(model => model.Occation)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Priority)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Priority)
    @Html.ValidationMessageFor(model => model.Priority)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Notes)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Notes)
    @Html.ValidationMessageFor(model => model.Notes)
</div>

<div class="editor-label">
    Employee
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.EmployeeID, ((IEnumerable<ShivamEMR.Model.Domain.CompanyDomain.Employee>)ViewBag.PossibleEmployees).Select(option => new SelectListItem
{
    Text = (option == null ? "None" : option.FullName),
    Value = option.ID.ToString(),
    Selected = (Model != null) && (option.ID == Model.EmployeeID)
}), "Choose...")
    @Html.ValidationMessageFor(model => model.EmployeeID)
</div>
<div class="editor-label">
    AppointmentGroup
</div>
 
<div class="editor-label">
    Venue
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.VenueID, ((IEnumerable<ShivamEMR.Model.Domain.CRMDomain.Venue>)ViewBag.PossibleVenues).Select(option => new SelectListItem
{
    Text = Html.DisplayTextFor(_ => option.Title).ToString(),
    Value = option.ID.ToString(),
    Selected = (Model != null) && (option.ID == Model.VenueID)
}), "Choose...")
    @Html.ValidationMessageFor(model => model.VenueID)
</div>
 

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>